<h2 class="sub-header"> <i class="glyphicon glyphicon-th-list"></i> Danh sách</h2>

<div class="table-responsive">
  <table class="table table-striped">
    <thead>
    <tr>
      <th class="no">No.</th>
      <th class="check_all"><input type="checkbox" class="custom_chk" id="selectAllItems"
                                   onclick="selectAllItems({{ count(result) }})"/>
      </th>
      <th class="th_left" onclick="sort('name')">
        <div id="username" class="sort icon_no_sort">Group name</div>
      </th>
      <th width="70" onclick="sort('status')">
        <div id="status" class="sort icon_no_sort">Status</div>
      </th>
      <th class="th_last" width="160" onclick="sort('created')">
        <div id="created" class="sort icon_sort_asc">Created</div>
      </th>
    </tr>
    </thead>
    <tbody>
    {% for key, v in result %}
      <tr>
        <td>{{ key + start +1 }}</td>
        <td>
          <input type="checkbox" class="custom_chk" id="item{{ key }}" onclick="selectItem({{ key }})"
                 value="{{ v.id }}"/>
        </td>
        <td><a href="{{ patch_root_admin }}/{{ module }}/update/{{ v.id }}">{{ v.name }}</a></td>
        <td>{{ v.status }}</td>
        <td>{{ v.created|date("d-m-Y H:i:s") }}</td>
      </tr>
    {% else %}
      <tr>
        <td colspan="6" align="center">Chưa có dữ liệu được cập nhập trong mục này.</td>
      </tr>
    {% endfor %}
    </tbody>
  </table>
</div>
{% if result %}
  <div class="footer_table">
    <div class="item_per_page">Items per page:</div>
    <div class="select_per_page">
      <select id="per_page" onchange="searchContent({{ start }},this.value)">
        <option {% if per_page == 10 %}  selected="selected" {% endif %} value="10">10</option>
        <option {% if per_page == 25 %}  selected="selected" {% endif %} value="25">25</option>
        <option {% if per_page == 50 %}  selected="selected" {% endif %} value="50">50</option>
        <option {% if per_page == 100 %}  selected="selected" {% endif %} value="100">100</option>
      </select>
    </div>

    <div class="pagination">{{ create_links }}</div>
  </div>
  <div class="clearAll"></div>
{% endif %}
